#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void reverse_string(char *string){
    int len = 0;
    len = strlen(string);
    printf("len = %d\n", len);
    if(len <= 1){
        return;
    }else{
        char temp = string[0];
        string[0] = string[len - 1];
        printf("%c\n", temp);
        string[len - 1] = '\0';
        reverse_string(string + 1);
        string[len - 1] = temp;
    }
}

int main() {
    char str[] = "HelloWorld";
    reverse_string(str);
    printf("\n");
    printf("%s", str);

    return 0;
}
